import request from '@/utils/request';
import { setToken } from '@/utils/token-util';


//新增 “摄像头套餐(价格)”——代理
export async function saveAgentCamera (data) {
  const res = await request.post('/business/monitorinRecord/save', data)
  if (res.data.code === 2000) {
    return res.data;
  }
  return Promise.reject(new Error(res.data.msg));
}

//查询 “摄像头列表”——代理（分页）
export async function queryCameraList (data) {
  const res = await request.post('/business/deviceInformation/selectFormationPage', data)
  if (res.data.code === 2000) {
    return res.data.data;
  }
  return Promise.reject(new Error(res.data.msg));
}

//删除 “摄像头列表”——代理（分页）
export async function delCamera (data) {
  const res = await request.post('/business/deviceInformation/delete', data)
  if (res.data.code === 2000) {
    return res.data.data;
  }
  return Promise.reject(new Error(res.data.msg));
}


//查询 “摄像头套餐”——代理
export async function queryAgentCamera (data) {
  const res = await request.post('/business/monitorinRecord/selectPage', data)
  if (res.data.code === 2000) {
    return res.data.data;
  }
  return Promise.reject(new Error(res.data.msg));
}

//查询 “摄像头管理——余额记录” ——代理
export async function queryAgentMoney (data) {
  const res = await request.post('/business/camera/selectMoneyPage', data)
  if (res.data.code === 2000) {
    return res.data.data;
  }
  return Promise.reject(new Error(res.data.msg));
}


//测试
export async function deviceInformation (data) {
  const res = await request.post('/business/deviceInformation/save', data)
  if (res.data.code === 2000) {
    return res.data.data;
  }
  return Promise.reject(new Error(res.data.msg));
}

// 查询摄像头列表table——内嵌表格详情
export async function queryDeviceInfo (data) {
  const res = await request.post('/business/deviceInformation/deviceInfo', data)
  if (res.data.code === 2000) {
    return res.data.data;
  }
  return Promise.reject(new Error(res.data.msg));
}

// 摄像头列表——余额记录——总汇总（今日/每日/总使用余额汇总）
export async function queryBalanceRecord (data) {
  const res = await request.post('/business/ysyBalanceRecord/deviceInfo', data)
  if (res.data.code === 2000) {
    return res.data.data;
  }
  return Promise.reject(new Error(res.data.msg));
}







